package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipRegularCheckWorkOrderService;
import cc.comac.mom.bean.EquipRegularCheckWorkOrder;
import cc.comac.mom.bean.EquipRegularCheckWorkOrderBean;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "/EquipRegularCheckWorkOrder")
public class EquipRegularCheckWorkOrderController {

	@Autowired
	private EquipRegularCheckWorkOrderService equipRegularCheckWorkOrderService;
	
	
	@ApiOperation("批量插入定检计划工单")
	@RequestMapping("/insertBatch")
	public ResultBean insertBatch(List<EquipRegularCheckWorkOrder> list) {
		return equipRegularCheckWorkOrderService.insertBatch(list);
	}
	
	@ApiOperation("分页查询定检计划工单")
	@RequestMapping("/selectByFields")
	public ResultBean selectByFields(@RequestBody EquipRegularCheckWorkOrderBean obj) {
		return equipRegularCheckWorkOrderService.selectByFields(obj);
	}
	
	@ApiOperation("定检计划工单调整日期")
	@RequestMapping("/adjustDate")
	public ResultBean adjustDate(@RequestBody EquipRegularCheckWorkOrder obj) {
		return equipRegularCheckWorkOrderService.adjustDate(obj);
	}
	
	@ApiOperation("修改定检计划工单执行用时")
	@RequestMapping("/updateExecuteTime")
	public ResultBean updateExecuteTime(@RequestBody EquipRegularCheckWorkOrder obj) {
		return equipRegularCheckWorkOrderService.updateExecuteTime(obj);
	}
	
	@ApiOperation("定检计划工单开始执行")
	@RequestMapping("/planStartExecute")
	public ResultBean planStartExecute(@RequestBody EquipRegularCheckWorkOrder obj) {
		return equipRegularCheckWorkOrderService.planStartExecute(obj);
	}
	
	@ApiOperation("批量删除定检计划工单")
	@RequestMapping("/deleteBatch")
	public ResultBean deleteBatch(@RequestBody List<Long> ids) {
		return equipRegularCheckWorkOrderService.deleteBatch(ids);
	}
}
